package vm;

import org.testng.annotations.Test;

import java.util.Arrays;
import java.util.Map;
import java.util.Properties;

public class VMParam {


    public static void main(String[] args) {
        System.out.println("输出args，这个args数组就是配置中的program arguments");
        for (String arg : args) {
            System.out.println(arg);
        }

        System.out.println("输出vm参数");
        String myArg1 = System.getProperty("Argu1");
        System.out.println(myArg1);

        // 系统变量
        Properties properties = System.getProperties();
        System.out.println("system properties: ");
        Arrays.stream(properties.toString().split(",")).forEach(System.out::println);

        // 环境变量
        Map<String, String> getenv = System.getenv();
        System.out.println("system env: \n" + getenv);
    }
}
